package com.cloud.feign.service;

import feign.hystrix.FallbackFactory;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description TODO
 * @Author 奶茶
 * Created by on 2019/1/6 9:24.
 */
public class HystrixClientFallbackFactory implements FallbackFactory<HelloService> {
    @Override
    public HelloService create(Throwable throwable) {
        return new HelloService() {
            @Override
            public String sayHi(@RequestParam(value = "name") String name) {
                return "sayHI to " + name + "fall,fall message" + throwable.getMessage();
            }
        };
    }
}
